package com.lg.spring.test;

import org.springframework.boot.loader.JarLauncher;

import java.net.URL;
import java.net.URLClassLoader;

/**
 * @author by Mr. Li 2020/5/25 11:56
 */
public class MyTest02 {
    public static void main(String[] args) {
        Class<JarLauncher> aClass = JarLauncher.class;

        System.out.println(aClass.getClassLoader());

        System.out.println("--------------------BootstrapClassLoader--------------------");
        URL[] urls = sun.misc.Launcher.getBootstrapClassPath().getURLs();
        for (URL url : urls) {
            System.out.println(url);
        }

        System.out.println("--------------------ExtClassLoader--------------------");
        URL[] urls2 = ((URLClassLoader) ClassLoader.getSystemClassLoader().getParent()).getURLs();
        for (URL url : urls2) {
            System.out.println(url);
        }

        System.out.println("--------------------AppClassLoader--------------------");
        URL[] urls3 = ((URLClassLoader) ClassLoader.getSystemClassLoader()).getURLs();
        for (URL url : urls3) {
            System.out.println(url);
        }
    }
}
